import request from '@/utils/request'

// 查询待取药列表
export function getMedicationList(query) {
  return request({
    url: '/check/medication/order/list',
    method: 'get',
    params: query
  })
}

// 发送配药机
export function pushPrescription(data) {
  return request({
    url: '/machine/prescription/push',
    method: 'post',
    data: data
  })
}

// 配药机订单收药
export function prescriptionDrugTake(data) {
  return request({
    url: '/machine/prescription/drug/take',
    method: 'post',
    data: data
  })
}

// 配药机授权列表
export function machineAuthorizeList(query) {
  return request({
    url: '/machine/authorize/list',
    method: 'get',
    params: query
  })
}

// 新增配药机授权
export function addMachineAuthorize(data) {
  return request({
    url: '/machine/authorize/add',
    method: 'post',
    data: data
  })
}

// 编辑配药机授权
export function updateMachineAuthorize(data) {
  return request({
    url: '/machine/authorize/update',
    method: 'post',
    data: data
  })
}

// 编辑配药机授权状态
export function updateMachineAuthorizeStatus(data) {
  return request({
    url: '/machine/authorize/status/update',
    method: 'post',
    data: data
  })
}

// 删除配药机授权
export function deleteMachineAuthorize(data) {
  return request({
    url: '/machine/authorize/delete',
    method: 'post',
    data: data
  })
}

// 获取配药机鉴权配置token
export function getMachineAuthorizeToken() {
  return request({
    url: '/machine/authorize/token/make',
    method: 'get'
  })
}
